package com.caration.shell.cr3d;

import com.caration.shell.config.CommonConfig;

import android.app.Activity;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.DisplayMetrics;

public final class SharedData {
	public static float a;
	public static float b;
	public static float c;
	public static float sDensity;
	private static int e;
	private static int f;
	private static int g;
	// private static z i;
	// private static ad j;
	private static Context sContext;
	private static GLSurfaceView sSurfaceView;
	private static GLHandler sGLHandler;

	public static void setContext(Context context) {
		sContext = context;
	}

	public static Context getContext() {
		return sContext;
	}

	public static void setGLView(GLSurfaceView glSurfaceView) {
		sSurfaceView = glSurfaceView;
	}

	public static GLSurfaceView getGLView() {
		return sSurfaceView;
	}

	public static void setGLHandler(GLHandler glHandler) {
		sGLHandler = glHandler;
	}

	public static GLHandler getGLHandler() {
		return sGLHandler;
	}

	public void onDestroy() {
		sContext = null;
		sSurfaceView = null;
	}

	public static void a(int paramInt) {
		g = paramInt;
	}

	public static void setupDensity(Activity activity) {
		sContext = activity;
		DisplayMetrics localDisplayMetrics = new DisplayMetrics();
		activity.getWindowManager().getDefaultDisplay()
				.getMetrics(localDisplayMetrics);
		sDensity = localDisplayMetrics.density;
		float scale = CommonConfig.getScreenScale();
		if (scale != 0.0F)
			c = scale;
		else if (localDisplayMetrics.density != 2.0F)
			c = localDisplayMetrics.density;
		else
			c = 1.8F;
		if (c < 1.0F)
			c = 1.0F;
		b = c / 1.8F;
		a = c / 1.5F;
	}

	// public static void a(ad paramad) {
	// j = paramad;
	// }
	//
	// public static void a(z paramz) {
	// i = paramz;
	// }

	public static int b() {
		return g;
	}

	public static void b(int paramInt) {
		e = paramInt;
	}

	public static int c() {
		return e;
	}

	public static void c(int paramInt) {
		f = paramInt;
	}

	public static int d() {
		return f;
	}

	// public static z f() {
	// return i;
	// }
	//
	// public static ad h() {
	// return j;
	// }
}
